/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.googlecode.jsimplemarket.model;

import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Alexandru.Codescu
 */
@Entity
@Table(name = "firme")
public class Firma extends AbstractEntitate {
    private String denumire;
    private String cif;
    private String codRegComertului;
    private String sediuSocial;
    private List<ObservatieFirma> observatii;
    private String dateContact;
    
    private List<Inchiriere> inchirieri;
    private List<IstoricInchirieri> istoric;
    private List<FisierAtasatFirma> fisierAtasatFirma;

    @Column(name = "DENUMIRE", unique = true, nullable = false, length = 200)
    public String getDenumire() {
        return denumire;
    }

    public void setDenumire(String denumire) {
        this.denumire = denumire;
    }

    @Column(name = "CIF", unique = true, length = 36)
    public String getCif() {
        return cif;
    }

    public void setCif(String cif) {
        this.cif = cif;
    }

    @Column(name = "COD_REGCOM", unique = true, length = 16)
    public String getCodRegComertului() {
        return codRegComertului;
    }

    public void setCodRegComertului(String codRegComertului) {
        this.codRegComertului = codRegComertului;
    }

    @Column(name = "ADRESA")
    public String getSediuSocial() {
        return sediuSocial;
    }

    public void setSediuSocial(String sediuSocial) {
        this.sediuSocial = sediuSocial;
    }

    @OneToMany(fetch = FetchType.LAZY)
    @JoinColumn(name = "ID_FRIMA")
    public List<ObservatieFirma> getObservatii() {
        return observatii;
    }

    public void setObservatii(List<ObservatieFirma> observatii) {
        this.observatii = observatii;
    }

    @Column(name = "DATE_CONTACT")
    public String getDateContact() {
        return dateContact;
    }

    public void setDateContact(String dateContact) {
        this.dateContact = dateContact;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "firma")
    public List<Inchiriere> getInchirieri() {
        return inchirieri;
    }

    public void setInchirieri(List<Inchiriere> inchirieri) {
        this.inchirieri = inchirieri;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "firma")
    public List<IstoricInchirieri> getIstoric() {
        return istoric;
    }

    public void setIstoric(List<IstoricInchirieri> istoric) {
        this.istoric = istoric;
    }
    
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "firma")
    public List<FisierAtasatFirma> getFisierAtasatFirma() {
        return fisierAtasatFirma;
    }
    
    public void setFisierAtasatFirma(List<FisierAtasatFirma> fisierAtasatFirma) {
        this.fisierAtasatFirma = fisierAtasatFirma;
    }   
}
